#include "ValidityException.h"
#include <stdio.h>
#include <stdarg.h>

ValidityException::ValidityException(ValidityError ec, const char*s, ...) : errorcode(ec) {
    char temp[1024];
    va_list ap;
    va_start(ap, s);
    vsprintf(temp, s, ap);
    va_end(ap);
    trace = temp;
}

ValidityException::~ValidityException() throw () {}

const char* ValidityException::what() const throw() {
    return trace.c_str();
}

inline ValidityError ValidityException::error() const throw() {
    return errorcode;
}
